home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20000217-20000824
/
000046_news@columbia.edu _Fri Feb 25 21:40:44 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
5KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id VAA29273
for <kermit.misc@watsun.cc.columbia.edu>; Fri, 25 Feb 2000 21:40:43 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id VAA22122
for kermit.misc@watsun.cc.columbia.edu; Fri, 25 Feb 2000 21:34:10 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: Peter Easthope <peter_easthope@gulfnet.pinc.com>
Subject: Re: Array name passed to macro as argument?
Date: Sat, 26 Feb 2000 01:57:39 GMT
Organization: Deja.com - Before you buy.
Message-ID: <897bui$l35$1@nnrp1.deja.com>
To: kermit.misc@columbia.edu
In <891805$ltt$1@newsmaster.cc.columbia.edu> posted at
2000 Feb 23 18:13:25 GMT Frank da Cruz said,
fdc> OK, here's another way that works in MS-DOS Kermit 3.15, as
fdc> well as in K95 and C-Kermit:
fdc>
fdc> def arraytest { ; Define macro
fdc> local \%x
fdc> assign \%x \\\%1[1]
fdc> echo {\%x}
fdc> assign \%x \\\%1[2]
fdc> echo {\%x}
fdc> }
fdc> declare \&a[10] ; Set up array
fdc> assign \&a[1] one
fdc> assign \&a[2] two
fdc> assign \&a[3] three
fdc>
fdc> arraytest &a ; Call macro with array name.
Thanks Frank. For the programming objective which
instigated the enquiry I found a nice solution based on
redefinition of a macro within a macro. With any luck you
will be able to examine it soon. Your instructions about
array syntax are recorded for future reference.
Perhaps a brief discussion and comparison of syntax of
formal languages can be tolerated here. This is for
interest and is not a criticism of Kermit.
I also program in J (http://www.jsoftware.com/ and
ftp://archive.uwaterloo.ca/languages/j/Welcome.html) and
can not help but compare the syntax. These are the
analogues in J of the Kermit operations you described.
The 3x3 identity matrix is placed in variable I thus.
I =. 3 3 $ 1 0 0 0
The value in I is copied to another variable v thus.
v =. I
If fn is a function which can take the value of I as an argument the
evaluation is invoked by this.
fn I
Alternatively, the name of the array, rather than the
value it contains, is passed to fn this way.
fn 'I'
Neither the assignment of the value of I to v nor the
evaluation of fn on I mention the components of I.
In <Jf10IGSklAzn@cc.usu.edu> posted at 2000 Feb 23 Joe
Doupnik said,
jd> Just a comment from the trenches on this item. The
jd> fancier notation used by Frank is nifty. However when it
jd> comes to implementing it in assembler within a small space
jd> for a DOS program and inside of especially complex code
jd> for parsing, then things are sticky. Thus I decided to
jd> not implement the dot semicolon-equal etc material as
jd> there are equivalent ways of accomplishing the goal.
jd> Apologies for the inconvience of having two ways of doing
jd> this.
Multiple syntaces--no problem.
I did not realize that MS-DOS Kermit is written in
assembler. Wow! The J interpreter was written in C. The
old J6 and possibly the J7 sources should still be
available on the ftp server noted above.
In <891dnn$qol$1@newsmaster.cc.columbia.edu> posted at
2000 Feb 23 19:51:19 GMT Frank da Cruz said,
fdc> ... MS-DOS Kermit is painstakingly constructed
fdc> for the traditional memory-constrained environment ...
I have used J6 on a PC with DOS 5.0 and never encountered
a limit. One J application was much larger than my Kermit
application. J6 must use extended memory or something
similar.
fdc> http://www.columbia.edu/kermit/scriptref.html
Thanks. I will study that.
In J, suppose A is a variable containing the number 30 and
B is a variable containing the number 45.
fdc> .variable = string
J doesn't have assignment-without-evaluation exactly; I
suppose the closest idea is to assign the name of a
variable to another variable.
variable =. 'A'
fdc> .variable := string
J analogue ...
variable =. A
Using the J function called Do the same result is obtained
from ...
variable =. ". 'A'
". evaluates the argument it receives.
fdc> .variable ::= string
J analogues ...
variable =. A + B
variable =. ". 'A + B'
Results of evaluation of strings can be combined with
ordinary evaluation.
variable =. 90 + ". 'A + B'
I draw these conclusions.
1. Some manipulations of an array, including transfer as
argument, can be performed without reference to
components.
2. The concepts of assignment and evaluation can be
represented by specific notations, as with =. and ". in
J, or by a single notation, as with ::= in Kermit.
Well, I hope this is more interesting than pedantic!
fdc> ... The script reference mentioned above shows you
which features you can use in which versions of each
program.
Thanks. I am aiming to make the scripts as interpreter
non-specific as possible.
Regards, Peter_Easthope@gulfnet.pinc.com
Sent via Deja.com http://www.deja.com/
Before you buy.